package interfaz;

import java.awt.event.MouseEvent;
import java.awt.event.MouseListener;


/**
 *
 * @author Nerea
 */
public class PanelHistoricoMediciones extends javax.swing.JPanel {

	// Variables declaration - do not modify
    private javax.swing.JButton bAceptar;
    private javax.swing.JButton bAtras;
    private javax.swing.JScrollPane jScrollPane1;
    private javax.swing.JLabel lNomSensor;
    private javax.swing.JLabel lTitulo;
    private javax.swing.JTable tabla;
    private PanelInicial panelInicial;
    private PanelMenu panelMenu;
    // End of variables declaration
    
    /**
     * Creates new form PanelHistoricoMediciones
     */
    public PanelHistoricoMediciones(PanelInicial pI, PanelMenu pM) {
       
    	panelInicial = pI;
    	panelMenu = pM;
        jScrollPane1 = new javax.swing.JScrollPane();
        tabla = new javax.swing.JTable();
        lTitulo = new javax.swing.JLabel();
        lNomSensor = new javax.swing.JLabel();
        bAtras = new javax.swing.JButton();
        bAceptar = new javax.swing.JButton();

        setLayout(null);

        tabla.setModel(new javax.swing.table.DefaultTableModel(
            new Object [][] {
                {null, null, null, null},
                {null, null, null, null},
                {null, null, null, null},
                {null, null, null, null},
                {null, null, null, null},
                {null, null, null, null},
                {null, null, null, null},
                {null, null, null, null},
                {null, null, null, null},
                {null, null, null, null}
            },
            new String [] {
                "Fecha", "Hora", "Coordenadas", "Valor"
            }
        ) {
            boolean[] canEdit = new boolean [] {
                false, false, false, false
            };

            public boolean isCellEditable(int rowIndex, int columnIndex) {
                return canEdit [columnIndex];
            }
        });
        jScrollPane1.setViewportView(tabla);

        add(jScrollPane1);
        jScrollPane1.setBounds(110, 100, 550, 370);

        lTitulo.setFont(new java.awt.Font("Tempus Sans ITC", 1, 24)); // NOI18N
        lTitulo.setText("Historico mediciones del sensor: ");
        add(lTitulo);
        lTitulo.setBounds(110, 40, 400, 30);

        lNomSensor.setText("sensor1");
        add(lNomSensor);
        lNomSensor.setBounds(520, 40, 140, 30);

        bAtras.setText("Atras");
        bAtras.addMouseListener(new MouseListener() {
			public void mouseClicked(MouseEvent evt) {
				menu(evt);
			}

			public void mouseEntered(MouseEvent arg0) {

			}

			public void mouseExited(MouseEvent arg0) {

			}

			public void mousePressed(MouseEvent arg0) {	   }

			public void mouseReleased(MouseEvent arg0) {	}
		});
        add(bAtras);
        bAtras.setBounds(110, 520, 70, 30);

        bAceptar.setText("Aceptar");
        add(bAceptar);
        bAceptar.setBounds(590, 520, 71, 30);
    }// </editor-fold>
    
    private void menu(MouseEvent evt) {
		this.setVisible(false);
		panelInicial.ventana.getContentPane().add(panelMenu, 0);
		panelMenu.setVisible(true);
	}
    
}

